As an important function of a database system, partition is to divide and manage a large data table, which is indicated by a partition table, where the partition table may also include partition segments, and proper partitioning can improve performance of a database system, reduce the number of data read/write times of a system, and reduce a size of data processed by a database server, thereby facilitating database management. A partitioning policy is a cluster policy that design personnel sets for partitioning a large data table, where the partitioning policy specifies which partition segment a data record in the data table is mapped to. The database system further provides a data partition management function to implement partition management.
In the prior art, a database system supports three basic partitioning policies: range partitioning, list partitioning and hash partitioning, or supports other extended partitioning policies and combined partitioning policies. A partitioning policy and the number of partition segments impose a great impact on performance of a partition table. If a partition segment is too large, advantages of partitioning cannot be fully exerted, and if a partition segment is too small, there are too many partition tables, which increases time of query and optimization, and makes partition management more complex.
In the prior art, data partition management functions include adding a partition segment, deleting a partition segment (for range partitioning and list partitioning), reducing a partition segment (for hash partitioning), combining partition segments, splitting a partition segment, modifying a partition table name, and the like. When these management operations are implemented, data of a tuple of a partition may be modified, and the data may also be migrated between partition tables.
In the prior art, with the increase of data amount, partitioning performance and query performance are decreased due to improper partitioning; and for a management operation, higher data migration costs may be easily caused when partition segments are split or combined, and a part of partition segments or the whole partition table may be locked, which decreases system performance and is bad for database system management.